Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lodepng

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodepng

Bindings for LodePNG which decodes and encodes PNG images.

  • 0.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.6K
increased by37.38%
Maintainers
1
Weekly downloads
 
Created
Source

LodePNG Node.js bindings

Bindings for LodePNG which decodes and encodes PNG images.

Installation

npm install --save lodepng

Usage

var fs = require('fs')
var png = require('lodepng')

/** Decoding **/

var src = fs.readFileSync('test.png')

png.decode(src, function (err, res) {
  if (err) throw err

  console.log('Image size: ' + res.width + 'x' + res.height)
  // res.data is a Buffer with RGBA data
})

/** Encoding **/

var src = fs.readFileSync('test.raw')

png.encode(src, function (err, res) {
  if (err) throw err

  // res is a Buffer with PNG data
})

API

png.decode(source, cb)

Decode PNG data to raw RGBA buffer.

png.encode(source, cb)

Encode raw RGBA buffer to PNG data.

FAQs

Package last updated on 17 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc